<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<!--{$CHARSET}-->" />
	<title><!--{$title}--> -<!--{$config_core.seo_title}--></title>
	<meta name="keywords" content="<!--{$config_core.head_keywords}-->" />
	<meta name="description" content="<!--{$config_core.head_description}-->" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<meta name="generator" content="CityBao System" />
	<meta name="author" content="www.citybao.net" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="shortcut icon" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="bookmark" />
	<link href="<!--{$CSS_DIR}-->citybao.css" rel="stylesheet" type="text/css" />
	<link href="<!--{$CSS_DIR}-->member.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript">
		var CB_CssPath = '<!--{$CSS_DIR}-->';
		var CB_ImgPath = '<!--{$IMG_DIR}-->';
		var CB_JsPath  = '<!--{$JS_DIR}-->';
		<!--{if $SAFE_DOMAIN != ''}-->
		document.domain = '<!--{$SAFE_DOMAIN}-->';
		<!--{/if}-->
	</script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->common.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->member-menu.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->Dialog.js"></script>
	<script type="text/javascript">
		$(function() {
			//输入框样式
			$(':text,:password')
				.each(function(){
					if($(this).attr('id') == 'password'){
						$(this).bind('keyup',chkKeyboard);
						$(this).bind('keydown',chkKeyboard);
					}
				})
				.focus(function(){
					node = $(this).parents('span.input')
					node.removeClass('inputRed');
					node.addClass('inputGreen');
					showError($(this),'clear');
					if($(this).attr('id') == 'password'){
						$('#passW').show();
					}
				}).blur(function(){
					node = $(this).parents('span.input')
					node.removeClass('inputGreen');
					validate($(this));
				});
				//表单提交验证
			$("#changepass").submit(function(){
				var ajax = true;//是否启用Ajax
				var flag=true;
				$(':password').each(function(){
					if($(this).val() == ''){
						Dialog("提示","text:请完善表单后再提交!","400","150",true,"",true);
						flag = false;
						return false;
					}
				});
				if(flag&&ajax){
					$.ajax({
						url:window.location.herf,
						type: "POST",
						data:$("#changepass").serialize(),
						success:function(responseText){
							if(responseText.search("OK")>=0){
								Dialog("提示","text:密码修改成功！","400","150",true,"",true);
							}else{
								Dialog("提示","text:密码修改失败！<br />原因："+responseText,"400","150",true,"",true);
							}
						}
					});
					return false;
				}else{
					return flag;
				}
			});
		});
				
		/**
		 * 验证表单
		 */
		function validate(e){
			var msg = 'custom';
			if(e.attr('name') == 'password' || e.attr('name') == 'old_password'){
				msg = checkPassword(e.val());
			}
			if(e.attr('name') == 'password2'){
				msg = checkPassword2(e.val());
			}
			showError(e,msg);
		}
	
		/**
		 * 检验密码的合法性
		 */
		 function checkPassword(str){
			var len=str.length;
			if(str == '')
				return '密码不能为空！';
			if (len>16||len<6)
				return '密码长度不正确！';
			return 'hide';
		 }
			
		/**
		 * 检验两次输入密码是否相同
		 */
		 function checkPassword2(str){
			var password = $("#password").val();
			if(str == '')
				return '密码不能为空！';
			if(str !== password)
				return '两次输入密码不一致！';;
			return 'hide';
		 }
		
	</script>
</head>
<body>
<!--{include file='header.tpl'}-->
<!--{assign var='guide_suffix' value='修改密码'}-->
<!--{include file='guide.tpl'}-->
<div id="container" class="clearfix">
	<!--{include file='member/member-menu.tpl'}-->
	<div class="member-main" id="member-main">
		<div class="fillet filletColor7">
			<b class="fillet1"></b><b class="fillet2"></b><b class="fillet3"></b><b class="fillet4"></b>
			<div class="filletContent padding10">
				<div class="fRed tCenter" id="error"><!--{$error}--></div>
				<form action="" method="post" name="changepass" id="changepass">
					<input type="hidden" name="forward" value="<!--{$forward}-->" id='forward' />
					<input type="hidden" name="validate" value="<!--{$validate}-->" />
					<dl class="formList">
						<dd>
							<div class="colum_left">
								旧密码：<span class="fRed">*</span>
							</div>
							<div class="colum_right">
								<div class="inputbox">
									<span class="input">
										<cite><input id="old_password" name="old_password" type="password" maxlength="37" alt="旧密码:errArea{old_passwordtip}" value="" /></cite>
									</span>
								</div>
								<span id="old_passwordtip" class="tip"></span>
								<div class="inputtip fGray">请输入您当前正在使用的密码，以确认您的身份</div>
							</div>
						</dd>
						<dd>
							<div class="colum_left">
								登录密码：<span class="fRed">*</span>
							</div>
							<div class="colum_right">
								<div class="inputbox">
									<span class="input">
										<cite><input id="password" name="password" type="password" alt="密码:errArea{passwordtip}" value="" /></cite>
									</span>
								</div>
								<span class="inputfloat" id="passW">
									<div class="passW" id="passW1"><span class="passW_w"></span><span class="passW_t">弱</span></div>
									<div class="passW" id="passW2"><span class="passW_w"></span><span class="passW_t">中</span></div>
									<div class="passW" id="passW3"><span class="passW_w"></span><span class="passW_t">强</span></div>
								</span>
								<span id="passwordtip" class="tip"></span>
								<div class="inputtip fGray">6-20个字符，区分大小写，推荐使用数字、字母和特殊符号组合</div>
							</div>
						</dd>
						<dd>
							<div class="colum_left">
								确认密码：<span class="fRed">*</span>
							</div>
							<div class="colum_right">
								<div class="inputbox">
									<span class="input">
										<cite><input id="password2" name="password2" type="password" alt="确认密码:errArea{password2tip}"  value="" /></cite>
									</span>
								</div>
								<span id="password2tip" class="tip"></span>
							</div>
						</dd>
					</dl>
					<dl class="formList">
						<dd>
							<div class="colum_left"></div>
							<div class="colum_right">
								<input type="submit" class="btn_submit" value="提交" />
							</div>
						</dd>
					</dl>
				</form>
			</div>
			<b class="fillet5"></b><b class="fillet6"></b><b class="fillet7"></b><b class="fillet8"></b>
		</div>
	</div>
</div>
<!--{include file='footer.tpl'}-->
</body>
</html>